﻿package wibrst.loading {
	import flash.display.Sprite;
	import flash.text.TextField;
	import wibrst.loading.VSwfLoading;
	
	/**
	 * ...
	 * @author wibrst@qq.com
	 */
	public class VUISwfLoading extends VSwfLoading{
		
		public function VUISwfLoading() {
			trace( this, "-- construction --" );
		}
		
		override protected function initAction():void {
			mcLoadingMotion.scaleX = nBaseMotionScale;
		}
		
		override protected function startAction():void {
			trace( this, "startAction" );
			super.startAction();
			gotoAndStop(1);
			
			txLoadContent.text = super.sPromptSwfLoad;
			mcLoadingMotion.scaleX = nBaseMotionScale;
		}
		
		override protected function progAction( nPercent:Number, sPercent:String ):void{
			trace( this, "progAction", sPercent );
			if (txPercentLoading) txPercentLoading.text = "游戏准备中..." + sPercent;
			mcLoadingMotion.scaleX = nBaseMotionScale + nPercent * (1 - nBaseMotionScale);
			//trace( this, "\t\t\t----", sPercent, txPercentLoading, txPercentLoading.text );
		}
		
		/// pre-layed
		public var txLoadContent:TextField;
		public var txPercentLoading:TextField;
		public var mcLoadingMotion:Sprite;

		/// data
		private var nBaseMotionScale:Number = 0;
		
	}

}